import Vue from 'vue'
import VueRouter from 'vue-router'
import HomeView from '../views/main/HomeView.vue'
import Layout from '../views/Layout.vue'

Vue.use(VueRouter)

const routes = [
  {
    path:'/',
    name:'layout',
    component:Layout,
    children:[
    {
    path: '',
    name: 'home',
    component: HomeView,
    meta:{
      isLogin:true
    }
    },{
      path:'params',
      name:'Parmas',
      component:()=>import('../views/main/Params.vue'),
      meta:{
        isLogin:true
      }
    },
    {
      path:'ad',
      name:'ADCategory',
      component:()=>import('../views/main/ADCategory.vue'),
      meta:{
        isLogin:true
      }
    },
    {
      path:'product',
      name:'Product',
      component:()=>import('../views/main/Product.vue'),
      meta:{
        isLogin:true
      }
    },

    ]
  },
  {
    path:'/login',
    name:'Login',
    component:()=>import('../views/Login.vue')
  }
 
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
